Skip to content

Add raw binary fixture support for gossip harness#216

Open
cmoyes-jump wants to merge 6 commits intomainfrom
cmoyes/testsuite
Open

Add raw binary fixture support for gossip harness#216
cmoyes-jump wants to merge 6 commits intomainfrom
cmoyes/testsuite

Conversation

@cmoyes-jump
Copy link
Contributor

No description provided.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for harnesses that consume raw binary inputs (rather than serialized protobuf contexts) and produce a minimal raw output, primarily to support the gossip harness workflow end-to-end (download → convert → run).

Changes:

  • Introduces a raw_binary_io flag on HarnessCtx and enables it for GossipHarness.
  • Adds logic to convert non-protobuf .fix artifacts into harness-specific context protobufs (e.g. .gossipctx) during repro fetching/debugging.
  • Updates the target execution path to pass raw bytes in and decode a 1-byte boolean result out; adds tests for raw crash → context conversion.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/test_scripts.py Adds unit tests covering raw .fix conversion behavior (convert raw, skip valid fixtures).
src/test_suite/test_suite.py Adds lineage→raw-harness inference and .fix→context conversion during repro workflows.
src/test_suite/sanitizer_utils.py Builds sancov stub under $TMPDIR when set (else falls back to tempfile.gettempdir()).
src/test_suite/multiprocessing_utils.py Adds raw-binary execution path for input + special-case decoding for 1-byte boolean output.
src/test_suite/fuzz_interface.py Extends HarnessCtx with raw_binary_io configuration flag.
src/test_suite/fuzz_context.py Enables raw_binary_io=True for GossipHarness.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for harnesses that consume/produce raw binary data (rather than protobuf-serialized contexts/effects), with initial enablement for the gossip harness and conversion of raw .fix crash artifacts into .gossipctx context files.

Changes:

  • Introduce HarnessCtx.raw_binary_io and enable it for GossipHarness.
  • Convert raw .fix crash files into harness-specific context protobufs during repro download/debug flows.
  • Update process_target to send raw bytes (context.data) and decode single-byte boolean outputs for raw-binary harnesses; add focused tests for conversion.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
tests/test_scripts.py Adds tests validating raw .fix.gossipctx conversion and ensuring valid fixtures are not converted.
src/test_suite/test_suite.py Adds harness inference from lineage and conversion of raw crashes to context protobufs in debug_mismatches / debug_mismatch.
src/test_suite/multiprocessing_utils.py Updates target invocation to support raw-binary input/output handling in process_target.
src/test_suite/fuzz_interface.py Adds raw_binary_io flag to the harness context interface.
src/test_suite/fuzz_context.py Enables raw_binary_io for GossipHarness.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +1545 to +1549
converted = _convert_raw_crashes_to_contexts(globals.inputs_dir, harness)
if converted > 0:
default_harness_ctx = next(
name for name, obj in HARNESS_MAP.items() if obj is harness
)
Comment on lines +1747 to +1755
converted = _convert_raw_crashes_to_contexts(
globals.inputs_dir, harness_ctx_for_lineage
)
if converted > 0:
default_harness_ctx = next(
name
for name, obj in HARNESS_MAP.items()
if obj is harness_ctx_for_lineage
)
try:
meta = _MetadataOnlyFixture()
meta.ParseFromString(raw)
if meta.HasField("metadata") and meta.metadata.fn_entrypoint:
Comment on lines +214 to +218
if harness_ctx.raw_binary_io and len(output_data) == 1:
for field_desc in output_object.DESCRIPTOR.fields:
if field_desc.type == field_desc.TYPE_BOOL:
setattr(output_object, field_desc.name, output_data[0] != 0)
break
Comment on lines +179 to +183
if harness_ctx.raw_binary_io:
in_data = context.data
else:
serialized_instruction_context = context.SerializeToString(deterministic=True)
if serialized_instruction_context is None:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants